<template>
	<view class="flex flex-wrap padding-sm justify-between">
		<company-job-item v-for="item in list" :jobdata="item"/>
	</view>
</template>

<script>
import { jobGet } from '../../api/job';
	export default {
		data() {
			return {
				list:[],
				page:1
			};
		},
		onLoad() {
			jobGet().then(res=>{
				this.list = res.data.results
				this.page++
			})
		},
		onReachBottom() {
			console.log('触底了');
			jobGet(this.page).then(res=>{
				let {results} = res.data
				if(results.length){
					this.list = [
						...this.list,
						...results
					]
					this.page++
					return
				}
				uni.showToast({
					title:'没有更多数据了',
					icon:'none'
				})
			})
		}
	}
</script>

<style lang="scss">

</style>
